/**
 * Created with Intellij IDEA.
 * Description;
 * User:墨琦
 * Data:2023-03-09
 * Time:19:38
 */
public class main3 {
    public static void main(String[] args) {
        int[] array={1,2,3,4,5};
        int[] array1=null;

        String ret=myToString(array);
        System.out.println(ret);
    }
    public static String myToString(int[] array) {
        if(array==null||array.length==0)
        {
            return null;
        }
      String fw="[";
      int i=0;
        for (int t=0;t<array.length;t++) {
           fw+=array[t];
           if(t!=array.length-1) {
               fw += ",";
           }
        }
        fw+="]";
        return fw;
    }
}
